package com.fary.controller;

import com.fary.po.User;
import com.fary.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.Errors;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice;
import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;

import javax.servlet.AsyncContext;
import javax.servlet.AsyncEvent;
import javax.servlet.AsyncListener;
import javax.servlet.http.HttpServletRequest;

import java.io.IOException;

import static org.springframework.http.HttpStatus.NOT_FOUND;

/**
 * @author Fary
 * @version 1.0
 * @description: TODO
 * @date 2022/1/6 10:10
 */

@RequestMapping
@Controller
public class HelloController {

    @Autowired
    private HelloService helloService;

    @PostMapping("/hello")
//    @ResponseBody
//    @ResponseStatus(value = NOT_FOUND, reason = "找不到")
    public String hello(@RequestBody User user, Errors errors, HttpServletRequest request) {
        return "index";
//        return helloService.hello();
    }
}
